< previous page page_228 next page >

Page 228
(table continued from previous page)
Flag ConstantDescription
cdlOFNLongNamesIf this flag is set, long filenames can be returned from the File Open dialog box.
cdlOFNPathMustExistThe path the user types in must exist. If it does not exist, then the user must locate the path manually instead of typing the value in.
cdlOFNOverwritePromptIf you set this option, the File Save As dialog box will generate a message box asking the user whether he or she wants to overwrite an existing file.

When working with the multiple filenames flag, the string returned will contain all the files in one long string, separated by a space character. The name of the path will be the first item listed in this space-delimited string. Heres an example:
9f31265bb40b592b1929e18a47ab28e5.gif
D:\Train\VB6\intro\samples\Chapter011-DialogBoxes About.frm About.frx
arrow.gif Chapter7.vbp Chapter7.vbw
Of course, this can cause problems with long filenames, because they may contain spaces. Therefore, if you choose the multiple filenames option, you should also choose the long filenames flag and the Explorer flag. If you use all these options, youll no longer get a space-delimited string but rather a Chr(0)-delimited string. The Chr() function returns a character for an ASCII code that cant be expressed on a keyboard. Chr(0) is a common delimiter for strings since the user cant type this on the keyboard.
If you just use the multiple filename and long filename flags without the Explorer flag, youll still get a space-delimited flag, which wont help you distinguish between the different files.
If you choose to use the multiple filenames option, youll also need to set the MaxFileSize property to the maximum number of bytes you expect to receive. This property can be set from 1 to 32767. I suggest setting this value to the maximum, because you cant be sure how many files a user might select. This way, you know youll have enough room to hold all the data the user selects.

 
< previous page page_228 next page >

If you like this book, buy it!